export const downloadTextFile = (text: string, fileName: string) => {
    const blob = new Blob([text], { type: 'text/plain' })
    const url = URL.createObjectURL(blob)
    const a = document.createElement('a')
    a.href = url
    a.download = fileName

    document.body.appendChild(a)
    a.click()
    document.body.removeChild(a)

    URL.revokeObjectURL(url)
}

export const toCamelCase = (s: string) => {
    if (s.length < 1) {
        return s
    }
    return s[0].toLowerCase() + s.slice(1)
}